/*package Example6point6;

import Example6point4.MyDate;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;

//计算银行贷款，按月还本付息
public class LoanJFrame extends JFrame implements ActionListener {
    private JTextField[] texts;
    private JSpinner spin_year,spin_month;
    private MyDate paydate;
    private JButton button;
    private DefaultListModel tabelmodel;

    public LoanJFrame(){
        super("计算银行贷款，按月还本付息");
        this.setBounds(300,240,800,360);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        JPanel cmdpanel=new JPanel();
        this.getContentPane().add(cmdpanel,"North");
        String[] str={"贷款金额","元 贷款利率","%/月  贷款年限","年  还款起始","年","月"};
        String[] str_text={"100000","0.5025","1"};
        this.texts=new JTextField[str_text.length];
        int i=0;
        for (; i < str_text.length; i++) {
            cmdpanel.add(new JLabel(str[i]));
            cmdpanel.add(this.texts[i]=new JTextField(str_text[i],6));
        }
        for (;i<str.length;i++)
            cmdpanel.add(new JLabel(str[i]));

            Calendar start=Calendar.getInstance();
            int year=start.get(Calendar.YEAR);
            int month=start.get(Calendar.MONTH)+1;
            month=month%12+1;
            if (month==1)
                year++;
                int day=MyDate.daysOfMonth(year,month);
                this.paydate=new MyDate(year,month,day);

                this.spin_year=new JSpinner(new SpinnerNumberModel(year,year,year+2,1));
                cmdpanel.add(this.spin_month,9);

                cmdpanel.add(this.button=new JButton("计算"));
                this.button.addActionListener(this);

                String[] titles={"还款日期","本金余额(元)","月还金额(元)","月还利息(元)","月还本息(元)"};
                this.tabelmodel=new DefaultListModel(titles,1);
                JTable jtable=new JTable(this.tabelmodel);
                this.getContentPane().add(new JScrollPane());
                this.setVisible(true);
    }
    @Override
    public void actionPerformed(ActionEvent event) {

        double leavings=Double.parseDouble(""+texts[0].getText());
        double rate=Double.parseDouble(""+texts[1].getText());
        int months=Integer.parseInt(texts[2].getText())*12;
        double pay=leavings/months;
        this.tabelmodel.setRowCount(months);

        int year=(Integer)this.spin_year.getValue();
        int month=(Integer)this.spin_month.getValue();


        MyDate alterdate=new MyDate(year,month,MyDate.daysOfMonth(year,month));
        if (alterdate.com)

    }
}*/
